fix(onboard): use sudo lsof fallback to identify root-owned port blockers (fixes #726)#745
Conversation
…kers (fixes NVIDIA#726) Non-root users cannot see root-owned listeners with lsof, causing the onboard preflight to fall through to the net probe which can only report EADDRINUSE without process details. Users then see a generic 'Could not identify the process' message suggesting 'lsof -i :PORT' which also returns empty without sudo. Changes: - preflight.js: When lsof returns empty, retry with 'sudo lsof' to identify root-owned listeners (e.g., docker-proxy, leftover gateway) before falling through to the net probe - onboard.js: Update the user-facing hint to suggest 'sudo lsof' instead of plain 'lsof'
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughWalkthroughThe Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
|
Thanks for submitting this PR, it improves the onboarding process by using sudo lsof fallback to identify root-owned port blockers, which could improve the user experience and prevent potential issues for new users. |
|
Thank you for the review, @wscurran! Happy to help improve the onboarding experience. |
|
Gentle ping — this has been open for a week. Let me know if there's anything to adjust. Will close in 7 days if no response. 🙏 |
1 similar comment
|
Gentle ping — this has been open for a week. Let me know if there's anything to adjust. Will close in 7 days if no response. 🙏 |
Fixes #726
Problem
When a non-root user runs NemoClaw onboarding and port 8080 is occupied by a root-owned process (e.g.,
docker-proxy, leftover gateway),lsofreturns empty output because non-root users cannot see root-owned listeners. The preflight falls through to the net probe which detectsEADDRINUSEbut cannot identify the blocking process. The user sees:Running that command also returns empty without
sudo, leaving the user stuck.Solution
preflight.js: When regularlsofreturns empty, automatically retry withsudo lsofto identify root-owned listeners before falling through to the net probe. This gives users actionable process info (name + PID) instead of a generic EADDRINUSE message.onboard.js: Update the user-facing hint to suggestsudo lsofinstead of plainlsof.Testing
All existing preflight tests pass (9/9). The sudo fallback is skipped when
lsofOutputis injected (test mode), so no test changes needed.Summary by CodeRabbit